/* Copyright (c) 2004-2022 peigen.info. All rights reserved. */
package com.gitee.peigenlpy.actable.example.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import com.gitee.peigenlpy.actable.example.repository.entity.enums.CustomerStatus;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

/**
 * <b>(CustomerEntity)</b>
 * 客户表
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/1
 */
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "customer", comment = "客户表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "customer")
public class CustomerEntity extends AbstractCreateTimeEntity {
    @Column(name = "customer_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "customerId")
    @Unique(value = "customerId", columns = "customer_id")
    @org.beetl.sql.annotation.entity.Column("customer_id")
    String         customerId;
    @Column(name = "status", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false,
            comment = "客户状态;INIT:初始化, QUICK_REGISTER:快速注册客户, UN_ACTIVATED:注册未激活, UN_CERT:未实名, CERT_PASS:已实名, NORMAL:正常客户, FREEZE:账户被冻结, UN_SUBSCRIBE:账户被注销")
    @Index(value = "status", columns = "status")
    @org.beetl.sql.annotation.entity.Column("status")
    CustomerStatus status;
    @Column(name = "customer_score", type = MySqlTypeConstant.BIGINT, length = 30, isNull = false, comment = "客户积分")
    @org.beetl.sql.annotation.entity.Column("customer_score")
    Long           customerScore;
    @Column(name = "mobile", type = MySqlTypeConstant.VARCHAR, length = 20, comment = "手机号")
    @Unique(value = "mobile", columns = "mobile")
    @org.beetl.sql.annotation.entity.Column("mobile")
    String         mobile;
    @Column(name = "email", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "邮件")
    @org.beetl.sql.annotation.entity.Column("email")
    String         email;
    @Column(name = "permission", type = MySqlTypeConstant.JSON, comment = "客户权限")
    @org.beetl.sql.annotation.entity.Column("permission")
    String         permission;
}